package com.bsoft.exchange.controller.hospitalization;

import com.bsoft.exchange.domain.HospitalizationRecordDomain;
import com.bsoft.exchange.domain.SSXXDomain;
import com.bsoft.exchange.pojo.GetOperationInfoPojo;
import com.bsoft.exchange.pojo.HospitalizationRecordPojo;
import com.bsoft.exchange.response.ResponseEntity;
import com.bsoft.exchange.service.HospitalizationCostService;
import com.bsoft.exchange.util.BaseResponse;
import com.bsoft.exchange.util.Constant;
import com.bsoft.exchange.util.TextUtils;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Created by zhangchen on 2019-10-31.
 */
@RestController
@RequestMapping(value = "operation")
public class OperationController {
    @Autowired
    HospitalizationCostService hospitalizationCostService;

    /**
     * waitting for completed
     */
    @ApiOperation("获取手术信息")
    @ResponseBody
    @RequestMapping(value = "/listQuery", method = RequestMethod.POST, produces = "application/json")
    public ResponseEntity getSurgeryInfo(@RequestBody @Validated GetOperationInfoPojo pojo) {
        ResponseEntity responseEntity = new ResponseEntity();
        List<String> list = new ArrayList<>();
        list.add("320911199109160336");
        pojo.setPatientIdList(list); // 测试数据
        BaseResponse<List<SSXXDomain>> dataResponse = hospitalizationCostService.getSurgeryInfo(pojo);
        responseEntity.setData(dataResponse.getData());
        responseEntity.setCode(dataResponse.getCode());
        responseEntity.setMessage(dataResponse.getMessage());
        return responseEntity;
    }
}


